<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>展览信息设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel='stylesheet' type='text/css' href='__PUBLIC__/Admin/css/admin_style.css' />
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/area.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/formValidator.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/formValidatorRegex.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/handlers.js"></script>
<style>
#uploaddiv { width:40%; float:left;}
#thumbnails { width:60%; float:right;}
</style>
<script>
var ajaxurl="{:U('getAreas')}";
var getTypes="{:U('getTypes')}";
function selectAllOptions()
{
  var selObj = document.getElementById('category');
  for (var i=0; i<selObj.options.length; i++) {
    selObj.options[i].selected = true;
  }
}
</script>

<script type="text/javascript">


		var swfu;
		window.onload = function () {
			swfu = new SWFUpload({
				// Backend Settings
				upload_url:"{:U('Admin/Attachment/uploadLogo')}" ,
				post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
                file_post_name : "filedata",
				// File Upload Settings
				file_size_limit : "3 MB",	// 2MB
				file_types : "*.jpg",
				file_types_description : "JPG Images",
				file_upload_limit : 1,

				// Event Handler Settings - these functions as defined in Handlers.js
				//  The handlers are not part of SWFUpload but are part of my website and control how
				//  my website reacts to the SWFUpload events.
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,

				// Button Settings
				button_image_url : "__PUBLIC__/images/SmallSpyGlassWithTransperancy_17x18.png",
				button_placeholder_id : "spanButtonPlaceholder",
				button_width: 180,
				button_height: 18,
				button_text : '<span class="button">请选择Logo文件<span class="buttonSmall">(不超过2M)</span></span>',
				button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
				button_text_top_padding: 0,
				button_text_left_padding: 18,
				button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
				button_cursor: SWFUpload.CURSOR.HAND,
				
				// Flash Settings
				flash_url : "__PUBLIC__/js/swfupload/swfupload.swf",

				custom_settings : {
					upload_target : "divFileProgressContainer"
				},
				
				// Debug Settings
				debug: false
			});
		};
</script>
<script type="text/javascript">
  $(document).ready(function(){
    $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){
			window.top.art.dialog({content:msg,lock:true,width:250,height:100,ok:function(){$(obj).focus();}});
		}});
		/*$("#name_cn").formValidator({onshow:"请输入用户名",onfocus:"用户名至少3个字符,最多50个字符",oncorrect:"输入正确"}).inputValidator({min:3,empty:{leftempty:false,rightempty:false,emptyerror:"两边不能有空符号"},onerror:"你输入的用户名非法,请确认"})
		    .ajaxValidator({
			datatype : "json",
			async : true,
			type: "GET",
			url : "{:U('/Admin/User/check_username',array('userid'=>$info['id']))}",
			success : function(data){
	            if( data == "0" ){
	            	return true;
	            }else{
	            	return false;
	            }
			},
			error: function(){
				window.top.art.dialog({content:"服务器没有返回数据，可能服务器忙，请重试",lock:true,width:250,height:100,ok:function(){}});
			},
			onerror : "该用户名已存在，请更换",
			onwait : "用户名校验中..."
		});*/
	//$("#mobilephone").formValidator({onshow:"请输入联系人的手机号码，可以为空哦",onfocus:"你要是输入了，必须输入正确",oncorrect:"谢谢你的合作",onempty:"你真的不想留手机号码啊？"}).inputValidator({min:11,max:11,onerror:"手机号码必须是11位的,请确认"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"你输入的手机号码格式不正确"});;
	//$("#telephone").formValidator({onshow:"请输入联系人的联系电话，可以为空哦",onfocus:"格式例如：0577-88888888",oncorrect:"谢谢你的合作",onempty:"你真的不想留联系电话了吗？"}).regexValidator({regexp:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",onerror:"你输入的联系电话格式不正确"});
    $("#email").formValidator({onshow:"请输入邮箱",onfocus:"邮箱6-100个字符,输入正确了才能离开焦点",oncorrect:"恭喜你,你输对了"}).inputValidator({min:6,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"你输入的邮箱格式不正确"});
  });
</script>
</head>
<body>
	<gt name="info.id" value="0">
		<form action="{:U('Admin/Exhibitor/edit')}" method="post" name="form" id="myform" onsubmit="selectAllOptions()">
		<input type="hidden" name="id" value="{$info.id}">
		<input type="hidden" name="user_id" value="{$info.user_id}">
	<else />
		<form action="{:U('Admin/Exhibitor/add')}" method="post" id="myform" onsubmit="selectAllOptions()">
		<input type="hidden" name="user_id" value="<?php echo intval(session('userid'));?>">
    </gt>
		<table width="98%" border="0" cellpadding="4" cellspacing="1" class="table">
	<col width="180px"/>	
	<col/>
	<tr class="table_title"><td colspan="2">参展商基本信息</td></tr>
	<tr class="ji">
	  <td class="left">公司名称（中文）</td>
	  <td><input type="text" name="name_cn" id="name_cn" size="35" maxlength="50" value="{$info.name_cn}">
	  </td>
	</tr>
	<tr class="tr">
	  <td class="left">公司名称（英文）</td>
	  <td ><input type="text" name="name_en" id="name_en" size="35" maxlength="50" value="{$info.name_en}" >
	  </td>
	</tr>
	<tr class="ji">
	  <td class="left">公司Logo</td>
	  <td>
	  <div id="uploaddiv">
		 <div id="divFileProgressContainer" style="height: 30px;"></div>
		 <div><span id="spanButtonPlaceholder"></span></div>
		 </div>
		 <div id="thumbnails">
			<img id="thumbnail" style="margin:5px;height:60px" <eq name="info.logo_url" value=""> src='__PUBLIC__/images/no_pic.jpg'<else/>src='{$info.logo_url}'</eq>  ></img>
		 </div>
		 <input type="hidden" name="logo_url" id="logo_url" size="35" maxlength="80" readOnly="true" value="{$info.logo_url}">
		 <input type="hidden" name="logo_name" id="logo_name" size="35" maxlength="80" readOnly="true" value="{$info.logo_name}">
	  </td>
	</tr> 
	 <tr class="tr">
		  <td class="left">公司类型</td>
		  <td colspan="3" class="lt">
				<select name="type_id" id="type" onchange="setValue(this.id)" style="width:150px">
					<volist name="type" id="vo">
						<option value="{$vo.id}" <eq name="vo.id" value="$info.type_id">selected=""</eq> >{$vo.name}</option>
					</volist>
				</select>
				<input type="hidden" id="type_name" name="type_name" value="{$info.type_name}"/>
		   </td>
		</tr> 
	<tr class="ji">
	  <td class="left">主要经营地点</td>
	  <td>
		<select name="province_id" id="province" onchange="loadArea(this,'city')">
			<option value="-1" selected>省份/直辖市</option>
			<volist name="province" id="one">
				<option value="{$one.area_id}" <eq name="one.area_id" value="$info.province_id">selected=""</eq>>{$one.area_name}</option>
			</volist>
		</select>
		<select name="city_id" id="city" onchange="loadArea(this,'district')">
			<gt name="info.id" value="0">
				<volist name="city" id="one">
					<option value="{$one.area_id}" <eq name="one.area_id" value="$info.city_id">selected=""</eq>>{$one.area_name}</option>
				</volist>
			<else/>
				<option value="-1" >市/县</option>	
			</gt>	
		</select>
		<select name="district_id" id="district" onchange="loadArea(this,'null')">
			<gt name="info.id" value="0">
				<volist name="district" id="one">
					<option value="{$one.area_id}" <eq name="one.area_id" value="$info.district_id">selected=""</eq>>{$one.area_name}</option>
				</volist>
			<else/>
				<option value="-1" <eq name="vo.id" value="$info.province_id">selected=""</eq>>镇/区</option>
			</gt>	
		</select>
		<input type="hidden" id="province_name" name="province_name" value="{$info.province_name}"/>
		<input type="hidden" id="city_name" name="city_name" value="{$info.city_name}"/>
		<input type="hidden" id="district_name" name="district_name" value="{$info.district_name}"/>
	  </td>
	</tr>
	<tr class="tr">
	  <td class="left">主营产品</td>
	  <td >
	  <input name="product1" id="product" type="text" maxlength="10" value="{$info.product1}">
	  <input name="product2" id="product" type="text" maxlength="10" value="{$info.product2}">
	  <input name="product3" id="product" type="text" maxlength="10" value="{$info.product3}">
	  <br/>
	  <input name="product4" id="product" type="text" maxlength="10" value="{$info.product4}">
	  <input name="product5" id="product" type="text" maxlength="10" value="{$info.product5}">
	  <input name="product6" id="product" type="text" maxlength="10" value="{$info.product6}">
	   <br/>
	  <input name="product7" id="product" type="text" maxlength="10" value="{$info.product7}">
	  <input name="product8" id="product" type="text" maxlength="10" value="{$info.product8}">
	  <input name="product9" id="product" type="text" maxlength="10" value="{$info.product9}">
	   <br/>
	   <span class="gray04">每空限填<span class="orange">１</span>种产品名称，建议10个字以下</span>
	  </td>
	</tr> 
	<tr class="tr">
		  <td class="left">主要经营行业</td>
		  <td colspan="3" class="lt">
			<p class="orange">
                        请选择完整的行业大类和子类，最多可添加 8 个。<br>
                        您选择的分类超细,目标客户越容易搜索到您。
            </p>
			<p>
				<select name="level_1" id="level_1" onchange="loadLevel(this,'level_2',0)" size="10" style="width:150px">
							<option value="0" selected>请选择</option>
							<volist name="level" id="one">
								<option value="{$one.id}">{$one.type_name}</option>
							</volist>
						</select>
						<select name="level_2" id="level_2" onchange="loadLevel(this,'level_3',0)" size="10" style="width:150px">
						</select>
						<select name="level_3" id="level_3" onchange="loadLevel(this,'null',0)" size="10" style="width:150px">
						</select>
			</p>		
			<p>
			<input type="button" value="添加" onclick="javascript:addCategory();">
			&nbsp;
			<input type="button" value="删除" onclick="javascript:removeCategory();">
			</p>		
			<p id="category_p">		
				<select name="categoryid[]" id="category" multiple="multiple" onchange="setValue(this.id)"  size="6" style="width:250px">
					<volist name="category" id="vo">
						<option value="{$vo.exhibittype_id}" >{$vo.category_name}</option>
					</volist>
				</select>
				<volist name="category" id="vo">
					<input type="hidden"  name="categoryname[]" id="h_{$vo.exhibittype_id}"  value="{$vo.category_name}"/>
				</volist>
			</p>
		   </td>
		</tr> 

	<tr class="ji">
	  <td class="left">公司描述</td>
	  <td title="公司描述">
		<textarea name="description" id="description" style="width:500px;height:75px">{$info.description}</textarea> <br>
	  </td>
	</tr> 		
	<tr class="table_title"><td colspan="2">联系人设置</td></tr>
	<tr class="tr">
	  <td class="left">联系人</td>
	  <td><input type="text" name="contact" id="contact" size="20" maxlength="5"  value="{$info.contact}">
			<input type="radio" class="radio" value="1" name="sex" id="sex1" <if condition="($info.sex eq 1) OR ($info['sex'] eq '') ">checked=""</if> >先生
			&nbsp;
			<input type="radio" class="radio" value="0" name="sex" id="sex2" <eq name="info.sex" value="0">checked=""</eq> >女士
	  </td>
	</tr>
	<tr class="tr">
	  <td class="left">部门</td>
	  <td><input type="text" name="department" id="department" size="20" maxlength="5"  value="{$info.department}">
	  </td>
	</tr>
	<tr class="tr">
	<td class="left">职位</td>
	<td>
	<input type="text" name="position" id="position"  maxlength="30" size="20" value="{$info.position}">
	</td>
	</tr> 
	<tr class="tr">
	  <td class="left">负责人</td>
	  <td><input type="text" name="charger" id="charger" size="20" maxlength="5"  value="{$info.charger}">
	  </td>
	</tr>
	<tr class="ji">
	  <td class="left">联系地址</td>
	  <td><input type="text" name="contact_add" id="contact_add" size="30" maxlength="5" value="{$info.contact_add}">
	  </td>
	</tr>
	<tr class="tr">
	<td class="left">邮编</td>
	<td>
	<input type="text" name="postcode" id="postcode" maxlength="30" size="30" value="{$info.postcode}">
	</td>
	</tr>    
	<tr class="ji">
	  <td class="left">电话</td>
	  <td><input type="text" name="telephone" id="telephone" size="30" maxlength="5"  value="{$info.telephone}">
	  </td>
	</tr>
	<tr class="tr">
	  <td class="left">手机号码</td>
	  <td><input type="text" name="mobilephone" id="mobilephone" size="30" maxlength="5" value="{$info.mobilephone}"  >
	  </td>
	</tr>
	<tr class="ji">
	<td class="left">传真</td>
	<td>
	<input type="text" name="fax" id="fax"  maxlength="30" size="30" value="{$info.fax}">
	</td>
	</tr> 
	<tr class="tr">
	  <td class="left">邮箱</td>
	  <td ><input type="text" name="email" id="email" size="30" maxlength="50" value="{$info.email}" >
	  </td>
	</tr>  
	<tr class="tr">
	  <td class="left">网址</td>
	  <td ><input type="text" name="website" id="website" size="30" maxlength="50" value="{$info.website}" >
	  </td>
	</tr>  
	<tr class="ji">
		<td >展商状态：</td>
		<td colspan="3" class="lt">
			<input type="radio" class="radio" value="1" name="status" id="status1" <if condition="($info.status eq 1) OR ($info['status'] eq '') ">checked=""</if> >启用
			<input type="radio" class="radio" value="0" name="status" id="status2" <eq name="info.status" value="0">checked=""</eq> >关闭
		</td>
	</tr>    
	</table>
<div id="bootline"></div>
<div id="btnbox" class="btn">
	<gt name="info.id" value="0">
		<input class="bginput" type="submit" name="dosubmit" value="修改" >
	<else />
		<input class="bginput" type="submit" name="dosubmit" value="提交">
	</gt>
		&nbsp;
    <input class="bginput" type="reset" name="Input" value="重置" >
</div>
</form>
</body>
